package com.athl.gulimall.search.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @className: com.athl.gulimall.search.config.GulimallElasticSearchConfig
 * @description: TODO
 * @author: 易鑫
 * @create: 2022-08-08 22:14
 */
@Configuration
public class GulimallElasticSearchConfig {

    @Bean
    public RestHighLevelClient esRestClient() {
        RestClientBuilder builder = RestClient.builder(new HttpHost("192.168.188.100", 9200, "http"));
        return new RestHighLevelClient(builder);
    }
}
